package com.adam.springbucks.mapper;

import com.adam.springbucks.per.entity.Person;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName: PersonMapper
 * @Author Adam
 * @Date 2022/10/29
 * @Description: PersonMapper 数据库操作接口, 基础 BaseMapper<Person>接口获得单表增删改查方法
 */
//@Repository
@Mapper
public interface PersonMapper extends BaseMapper<Person> {

    IPage<Person> findPersonByIds(Page<Person> page, @Param("name") List<Long> ids);
    /**
     * 自定义动态SQL
     */
    IPage<Person> findPersonByNameOrAge(Page<Person> page, @Param("name") String name, @Param("age") Integer age);

    Person findPersonByName(@Param("name") String name);

}
